#include "urldialog.h"
#include "ui_urldialog.h"

UrlDialog::UrlDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::UrlDialog), webEngineView(new QWebEngineView(this))
{

    WebObject *webObject=new WebObject();

    QWebChannel *channel=new QWebChannel();
    channel->registerObject(QStringLiteral("bridge"), webObject);
    webEngineView->page()->setWebChannel(channel);

    // 设置要加载的 URL
    webEngineView->setUrl(QUrl("http://127.0.0.1:3900"));

    ui->setupUi(this);
    ui->verticalLayout->addWidget(webEngineView);
}

UrlDialog::~UrlDialog()
{
    delete ui;
}
